import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);
// 引入组件
import home from '../views/home/home.vue';  //首页组件


const routes = [  //路由规则
    { path: '/', redirect: '/home' },
    { path: '/home', component:home },
    { path: '/all', component:()=>import('../views/all/all.vue')},  // 访问时惰性加载
    { path: '/mine', component:()=>import('../views/mine/mine.vue')}, // 访问时惰性加载
  ];

const routers = new VueRouter({
    routes,
    linkActiveClass:'mui-active'
});

export default routers;